<template>
  <button @click="counterStore.increment">{{ counterStore.count }}</button>
  {{ counterStore.dobuleCount }}

  <Ul>
    <li v-for="item in counterStore.list" :key="item.defineComponent">
      {{ item.name }}
    </li>
  </Ul>
</template>

<script setup>
// 1.导入 use 打头的方法
import { onMounted } from 'vue';
import { useCounterStore } from './stores/counter';
// 2.执行方法得到store实例对象
const counterStore = useCounterStore()
console.log(counterStore)
onMounted(() => {
  counterStore.getList()
})

</script>

<style scoped></style>
